﻿using Inovout.Web.Mvc;
using System;
using System.Linq;
using System.Web.Mvc;

namespace Inovout.Account.Web.Controllers
{
    public class UserController : BaseController
    {
        [AllowAnonymous]
        public ActionResult Identifier(string name)
        {
            ArgumentAssert.IsNotDefault(name, "id");
            if (Request.AcceptTypes != null && Request.AcceptTypes.Contains("application/xrds+xml"))
            {
                return Xrds(name);
            }
            return View();
        }

        public ActionResult Xrds(string name)
        {
            Response.ContentType = "application/xrds+xml";
            ViewBag.ServiceUri = new Uri(Request.Url, Url.Action("Provider","OpenId"));
            return View("Xrds");
        }
    }
}
